package com.zbl.zblproject.contract.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zbl.zblproject.contract.entity.Rebates;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author youlanqiang
 * @version 1.0
 * @date 2019/3/14
 */
@Repository
public interface RebatesMapper extends BaseMapper<Rebates> {

    @Delete("DELETE FROM zbl_rebates WHERE contract_id = #{id}")
    boolean deleteByContractId(Integer id);

    @Select("SELECT * FROM zbl_rebates WHERE contract_id = #{id}")
    List<Rebates> selectRebatesByContractId(Integer id);

}
